class Config {
  static const String loginBaseUrl = "http://10.0.0.211:6108/";
  static const String doctorBaseUrl = "http://10.0.0.211:6110/";
  static const String rpBaseUrl = "http://10.0.0.211:6111/";
  static const String fileBaseUrl = "http://10.0.0.211:6104/";

  static const String codeName = "code";
  static const int codeSuccessValue = 0;
  static const String msgName = "message";
  static const num reqTimeOut = 15 * 1000;
  static const num respTimeOut = 15 * 1000;


  static String formatMoney(num num) {
    String mark;
    try {
      mark = num.toString().split('.')[1];
    } catch (e) {
      print(e);
    }
    if (mark == null || mark.isEmpty) {
      return (num / 100).toStringAsFixed(2);
    }

    if (mark.length == 1) {
      if (mark == '0')
        return (num / 100).toStringAsFixed(2);
      else
        return (num / 100).toStringAsFixed(3);
    }
    return (num / 100).toStringAsFixed(4);
  }

  /// 格式化金额(格式化总价时展示用)
  static String formatMoneyForSumShow(num money) {
    return (money / 100).toStringAsFixed(2);
  }
}
